home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 December / 1985-12.d64 / file unprotect (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  911b  |  32 lines

  1. 100 open15,8,15,"i0":open2,8,2,"#":p$="unlock":rem to lock files, p$="lock"
  2. 110 t=18:s=0:nl$=chr$(0):gosub230
  3. 120 ifsn=255thenclose2:close15:end
  4. 130 t=tn:s=sn:gosub230
  5. 140 forj=0to7:r(j)=0:next:print"[147]type number of file"
  6. 150 print"you wish to ";p$;"[146]"
  7. 160 forj=0to7:ft(j)=j*32+2:print#15,"b-p";2;ft(j):get#2,ps$:ps(j)=asc(ps$+nl$)
  8. 170 ifps(j)<>0thenr(j)=1:gosub250:d=j:gosub360:iffl=1thenj=7
  9. 180 nextj:gosub370
  10. 190 getb$:ifb$=""then190
  11. 200 b=val(b$):ifb=tethen120
  12. 210 ifr(b)=0then190
  13. 220 gosub300:goto190
  14. 230 print#15,"u1";2;0;t;s:gosub380
  15. 240 get#2,tn$,sn$:tn=asc(tn$+nl$):sn=asc(sn$+nl$):return
  16. 250 get#2,j$:get#2,j$:c=0:f$(j)=""
  17. 260 get#2,a$:a=asc(a$+nl$)
  18. 270 ifa<>160anda<>0thenf$(j)=f$(j)+a$:c=c+1:ifc<17then260
  19. 280 te=j+1:ifa=0thenfl=1
  20. 290 return
  21. 300 print#15,"b-p";2;ft(b)
  22. 310 ifp$="lock"thenps(b)=ps(b)or64:print#2,chr$(ps(b));:gosub380:goto330
  23. 320 ps(b)=ps(b)and191:print#2,chr$(ps(b));:gosub380
  24. 330 print#15,"u2";2;0;t;s:gosub380
  25. 340 print"":fork=0to7:ifr(k)=1thend=k:gosub360
  26. 350 nextk:gosub370:return
  27. 360 x=(ps(d)and64)-4:x=x-(x<0)*36:printdchr$(x);f$(d):return
  28. 370 printte" next[146]":return
  29. 380 input#15,en,em$,et,es
  30. 390 ifenthenprinten,em$,et,es:stop
  31. 400 return
  32.